/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.dingtalk.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.dingtalk.entity.DingWorkRecord;
import com.vivo.dingtalk.dao.DingWorkRecordDao;

/**
 * 钉钉备忘信息Service
 * @author jyangye
 * @version 2018-10-31
 */
@Service
@Transactional(readOnly = true)
public class DingWorkRecordService extends CrudService<DingWorkRecordDao, DingWorkRecord> {

	public List<DingWorkRecord> getByStatu(String status) {
	    DingWorkRecord query = new DingWorkRecord();
	    query.setStatus(status.trim());
	    return findList(query);
    }

	public DingWorkRecord get(String id) {
		return super.get(id);
	}

	public DingWorkRecord getByRecordId(String recordId) {
		DingWorkRecord query = new DingWorkRecord();
		query.setRecordId(recordId);
		List<DingWorkRecord> recordList = findList(query);
		return recordList.size() > 0 ? recordList.get(0) : null;
	}
	
	public List<DingWorkRecord> findList(DingWorkRecord dingWorkRecord) {
		return super.findList(dingWorkRecord);
	}
	
	public Page<DingWorkRecord> findPage(Page<DingWorkRecord> page, DingWorkRecord dingWorkRecord) {
		return super.findPage(page, dingWorkRecord);
	}
	
	@Transactional(readOnly = false)
	public void save(DingWorkRecord dingWorkRecord) {
		super.save(dingWorkRecord);
	}
	
	@Transactional(readOnly = false)
	public void delete(DingWorkRecord dingWorkRecord) {
		super.delete(dingWorkRecord);
	}
	
}